package com.qf.common.domain.admin.dos;

import com.baomidou.mybatisplus.annotation.*;
import com.qf.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * 菜单管理
 * @TableName sys_menu
 */
@TableName(value ="sys_menu")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SysMenu extends BaseEntity {
    /**
     * 
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 父菜单ID
     */
    @TableField(value = "parent_id")
    private Long parentId;

    /**
     * 路由名称
     */
    @TableField(value = "name")
    private String name;

    /**
     * 菜单名称
     */
    @TableField(value = "title")
    private String title;

    /**
     * 路由路径
     */
    @TableField(value = "path")
    private String path;

    /**
     * 组件路径(如果不填,默认就是菜单路径,默认就是菜单路径,从前端src目录开始计算,例如:src/views/ads/index.vue)
     */
    @TableField(value = "component")
    private String component;

    /**
     * 菜单图标
     */
    @TableField(value = "icon")
    private String icon;

    /**
     * 排序
     */
    @TableField(value = "`rank`")
    private Integer rank;

    /**
     * 菜单类型(0:目录 1:菜单 2:接口 3:外链)
     */
    @TableField(value = "type")
    private Integer type;

    /**
     * 按钮权限标识
     */
    @TableField(value = "btn_perm")
    private String btnPerm;

    /**
     * 是否在菜单中显示
     */
    @TableField(value = "show_link")
    private Integer showLink;

    /**
     * 逻辑删除标识(0-未删除；1-已删除)
     */
    @TableField(value = "is_deleted")
    @TableLogic
    private Integer isDeleted;

    @ApiModelProperty(hidden = true)
    @TableField(exist = false)
    private List<SysRole> roles;

    /** 父菜单 **/
    @TableField(exist = false)
    private SysMenu parent;

    public SysMenu(Long id) {
        this.id = id;
    }
}